package com.vacomall.erp.web;

import com.vacomall.erp.model.s;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by root1 on 16/8/25.
 */
@Controller
public class Login {

    @InitBinder
    protected void initBinder(WebDataBinder binder) {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
    }

    @RequestMapping(value="/text",method = RequestMethod.GET)
    public String t(ModelMap model){
        model.addAttribute("t", "ttssssss");
        return "home";
    }

    @RequestMapping(value="/homeLayout",method = RequestMethod.GET)
    public String homeLayout(ModelMap model){
        model.addAttribute("t", "ttssssss");
        return "home_layout";
    }

 
}
